<?php
namespace app\tripapi\controller;
use think\Controller;
use think\Request;
class ApiBaseController extends Controller
{
    public $params;

    public function __construct()
    {
        parent::__construct();
        $this->params = $this->request->param();
    }

    // 上传图片
//    public function upload(){
//        $file = request()->file("image");
//        $info = $file->move('uploads');
//        $retInfo = array("status"=>200, "msg"=>"上传成功", "data"=>array());
//        if($info){
//            $fileInfo = array(
//                "file_name" => $info->getFilename(),
//                "file_url" => "/public/uploads/".str_replace('\\', '/', $info->getSaveName()),
//                "file_type" => $info->getExtension(),
//            );
//            $fileId = $this->attachFile->save($fileInfo);
//            $fileInfo["id"] = $this->attachFile->id;
//            $fileInfo["file_url"] = $this->request->domain().$fileInfo["file_url"];
//            $retInfo["data"] = $fileInfo;
//        }else{
//            $retInfo = array("status" => 500, "msg" => $file->getError(), "data" => array());
//        }
//        return json_api($retInfo);
//    }
}
